<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
	    <meta name="apple-mobile-web-app-capable" content="yes" />
	    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
	    <meta name="format-detection" content="telephone=no" />
		<title></title>
	</head>
	<body>
		<script type="text/javascript" src="https://s3.bytecdn.cn/ee/lark/js_sdk/h5-js-sdk-1.4.13.js"> </script>
		<script type="text/javascript">

			window.onload=function(){
				feishuCloseWindow();
			}

			function feishuCloseWindow(){
				var autoClose = 0;
				var indervalClose = setInterval(function(){

					if(autoClose >= 100){//等待10秒后还未关闭，则放弃尝试关闭
						alert("当前不是飞书环境，请手动关闭页面！");
						clearInterval(indervalClose);
						return;
					}

					if (window.h5sdk &&window.h5sdk.biz && window.h5sdk.biz.util) {//如果是飞书环境，直接关闭当前页面
						clearInterval(indervalClose);
						window.h5sdk.biz.navigation.close({});//调用飞书接口关闭当前页面
					}else{
						console.log("当前不是飞书环境，请手动关闭页面！")
					}
					autoClose += 1;
				}, 100);
			}

		</script>
	</body>
</html>